package org.springblade.common.utils.mq;

import com.github.thierrysquirrel.annotation.CommonMessage;
import com.github.thierrysquirrel.annotation.RocketMessage;
import com.github.thierrysquirrel.annotation.StartDeliverTime;
import com.github.thierrysquirrel.core.producer.MessageSendType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @author Jackey
 * @date 2023年04月25日 15:42
 */
@Slf4j
@Component
@RocketMessage(groupID = "GID_normal")
public class NormalSend {

	/**
	 * 工单预计完成时间提醒消息
	 * @param message 消息体
	 * @return
	 */
	@CommonMessage(topic = "normal", tag = "finish_date",messageSendType = MessageSendType.SEND)
	public String sendPlanFinishDate(@StartDeliverTime long startDeliverTime, String message) {
		log.info("===============延时队列生产工单预计完成时间提醒消息[{}]====================", startDeliverTime);
		log.info("发送时间:[{}],发送内容:[工单预计完成时间提醒消息:{}]", LocalDateTime.now(), message);
		return message;
	}
}
